home *** CD-ROM | disk | FTP | other *** search
-
-
-
- RRRRWWWWTTTTVVVVaaaallllSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++)))) RRRRWWWWTTTTVVVVaaaallllSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++))))
-
-
-
- NNNNaaaammmmeeee
- RWTValSetIterator<T,C> - Rogue Wave library class
-
- SSSSyyyynnnnooooppppssssiiiissss
- #include<rw/tvset.h>
-
-
-
- RWTValSet<T,C> vs;
- RWTValSetIterator<T,C> itr(vs);
-
- SSSSttttaaaannnnddddaaaarrrrdddd CCCC++++++++ LLLLiiiibbbbrrrraaaarrrryyyy DDDDeeeeppppeeeennnnddddeeeennnntttt!!!!
- RRRRWWWWTTTTVVVVaaaallllSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr requires the Standard C++ Library.
-
-
-
-
-
-
- DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn
- RRRRWWWWTTTTVVVVaaaallllSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr is supplied with TTTToooooooollllssss....hhhh++++++++ 7 to provide an iterator
- interface for class RRRRWWWWTTTTVVVVaaaallllSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr that is backward compatable with
- the container iterators provided in TTTToooooooollllssss....hhhh++++++++ 6.x. The order of iteration
- over an RRRRWWWWTTTTVVVVaaaallllSSSSeeeetttt is dependent on the supplied comparator object
- parameter C as applied to the values stored in the container. The
- current item referenced by this iterator is undefined after construction
- or after a call to rrrreeeesssseeeetttt(((()))).... The iterator becomes valid after being
- advanced with either a preincrement or ooooppppeeeerrrraaaattttoooorrrr(((()))). For both ooooppppeeeerrrraaaattttoooorrrr++++++++
- and ooooppppeeeerrrraaaattttoooorrrr(((()))), iterating past the last element will return a value
- equivalent to boolean ffffaaaallllsssseeee. Continued increments will return a value
- equivalent to ffffaaaallllsssseeee until rrrreeeesssseeeetttt(((()))) is called.
-
- PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
- None
-
- EEEExxxxaaaammmmpppplllleeeessss
- #include<rw/tvset.h>
-
-
-
- #include<iostream.h>
- #include<rw/cstring.h>
- int main(){
- RWTValSet<RWCString,greater<RWCString> > a;
- RWTValSetIterator<RWCString,greater<RWCString> > itr(a);
- a.insert("John");
- a.insert("Steve");
- a.insert("Mark");
- //Rejected, duplicates are not allowed
- a.insert("Steve");
- for(;itr();)
- cout << itr.key() << endl;
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- RRRRWWWWTTTTVVVVaaaallllSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++)))) RRRRWWWWTTTTVVVVaaaallllSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++))))
-
-
-
- return 0;
- }
- Program Output
- Steve
- Mark
-
- PPPPuuuubbbblllliiiicccc CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrrssss
- John
-
-
-
- RRRRWWWWTTTTVVVVaaaallllSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr<<<<TTTT,,,,CCCC>>>>(RWTValSet<T,C>&s);
-
-
-
-
-
-
- Creates an iterator for the set ssss. The iterator begins in an undefined
- state and must be advanced before the first element will be accessible
-
- PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr OOOOppppeeeerrrraaaattttoooorrrrssss
- RWBoolean
- ooooppppeeeerrrraaaattttoooorrrr(((())))();
-
-
- Advances sssseeeellllffff to the next element. If the iterator has advanced past the
- last element in the collection, ffffaaaallllsssseeee will be returned. Otherwise, ttttrrrruuuueeee
- will be returned.
-
- RWBoolean
- ooooppppeeeerrrraaaattttoooorrrr++++++++();
-
-
- Advances sssseeeellllffff to the next element. If the iterator has been reset or
- just created sssseeeellllffff will now reference the first element. If, before
- iteration, sssseeeellllffff referenced the last association in the set, sssseeeellllffff will now
- reference an undefined value and ffffaaaallllsssseeee will be returned. Otherwise, ttttrrrruuuueeee
- is returned. Note: no postincrement operator is provided.
-
- PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
- RWTValSet<T,C>*
- ccccoooonnnnttttaaaaiiiinnnneeeerrrr(((()))) const;
-
-
- Returns a pointer to the collection being iterated over.
-
- T
- kkkkeeeeyyyy() const;
-
-
- Returns the value referenced by sssseeeellllffff.
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- RRRRWWWWTTTTVVVVaaaallllSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++)))) RRRRWWWWTTTTVVVVaaaallllSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++))))
-
-
-
- void
- rrrreeeesssseeeetttt();
- void
- rrrreeeesssseeeetttt(RWTValSet<T,C>& s);
-
-
- Resets the iterator so that after being advanced it will reference the
- first element of the collection. Using rrrreeeesssseeeetttt(((()))) with no argument will
- reset the iterator on the current container. Supplying a RRRRWWWWTTTTVVVVaaaallllSSSSeeeetttt to
- rrrreeeesssseeeetttt(((()))) will reset the iterator on that container.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-